<template>
    <div class="list">
    <el-breadcrumb separator="/" class="breadcrumb">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>政策法规列表</el-breadcrumb-item>
    </el-breadcrumb>

    <div class="content">
    <el-table :data="policylawList" style="width: 100%" height="75vh" @row-click='handleTableRow'>
        
        <el-table-column prop="id" label="序号" align="center" type="index" width="250"/>
        <el-table-column prop="title" label="标题" align="center" min-width="500" />
        <el-table-column prop="publishDatetime" label="发布时间" align="center" width="250" >
        <template #default="scope">
        <span>{{ parseTime(scope.row.publishDatetime, '{y}-{m}-{d}') }}</span>
        </template>
        </el-table-column>
    </el-table>
    <pagination
        v-show="total>0 "
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getlist"/>
    </div>

</div>
  </template>

<script>
import { listPolicylaw } from '@/api/bid/policylaw'

export default {
    name:'PoliceLawlist',
    data() {
        return {
            loading:false,
            total:0,
            queryParams:{
                pageNum:1,
                pageSize:10
            },
            policylawList:[],
        }
    },
    created() {
        this.getlist();
        },
        methods: {
        getlist() {
            this.loading = true
            listPolicylaw(this.queryParams).then(response => {
                this.policylawList = response.rows
                this.total = response.total
                this.loading = false
            })
            },
            handleTableRow(row){
                this.$router.push({path:'/policylaw/detail',query:{id:row.id}})
            }
            },
}
// const getlist = () => {
//     Loading.value = true
//     listPolicylaw(data.queryParams).then(response => {
//         data.policylawList = response.rows
//         total.vaule = response.total
//         Loading.value = false
//     })
// }

// const handleTableRow = (row,column,event) => {
//     router.push('/policylaw/detail?id=${row.id}')
// }

// getlist();

</script>

<style lang="scss" scoped>
.list{
    .content {
    margin: 14px 30px 44px 30px;
    background: #FFFFFF;
    border-radius: 10px;
    opacity: 1;
    min-height: 860px;
    padding: 24px 21px 0 21px;
  }
}


</style>